package mysql

import (
	"database/sql"
	"fmt"
)

// 直接依赖模板创建表
func CreateTable(db *sql.DB, ip string) bool {

	// ip = strings.Replace(ip, ".", "_", -1)
	//设置参数以及执行sql语句
	insetStr := "create table %s like template"
	insetStr = fmt.Sprintf(insetStr, ip)
	fmt.Println(insetStr)
	var _, execErr = db.Exec(insetStr)
	if execErr != nil {
		fmt.Println(execErr)
		return false
	}
	return true

}
